home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 5
/
Skunkware 5.iso
/
src
/
X11
/
xsw
/
include
/
xsw.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-09
|
19KB
|
895 lines
/*
* @(#) xsw.h 12.1 95/05/09 SCOINC
*/
/***************************************************************************
*
* Copyright (c) 1990-1993 The Santa Cruz Operation, Inc.
*
* All rights reserved. No part of this program or publication may be
* reproduced, transmitted, transcribed, stored in a retrieval system,
* or translated into any language or computer language, in any form or
* by any means, electronic, mechanical, magnetic, optical, chemical,
* biological, or otherwise, without the prior written permission of:
*
* The Santa Cruz Operation , Inc. (408) 425-7222
* 400 Encinal St., Santa Cruz, California 95060 USA
*
**************************************************************************/
/*
* Modification History
*
* S004, 25-Oct-93, rickra
* Added 32v5 streams.....stuff
*
* S003, 25-Oct-93, rickra
* Removed double semicolons on four variables
*
* S002, 21-Sep-93, rickra
* Added disk space stuff...
*
* S001, 27-May-93, rickra
* Added support for seperate windows.......
*
* S000, 30-Sep-92, rickra
* Added copyright and modification history
*/
#include "include/xswclient.h"
/* borrowed code from u386mon needs this and it may be ported someday */
#if defined(M_UNIX)
#define SVR32
#define HAS_FTIME
#define USIZE_FIXED
#endif
char *getenv ();
char *strchr ();
char *strrchr ();
/*
#ifdef __STDC__
void *malloc();
#else
char *malloc();
#endif
*/
#define DRAWING_WINDOW 0
#define SCROLLED_WINDOW 1
typedef struct _window_init_struct{
int Drawing_Width;
int Drawing_Height;
} window_init_struct;
typedef struct DestroyCallbackStruct
{
caddr_t server_pointer;
int button;
Atom WM_DELETE_WINDOW;
} DestroyCallbackClientData;
typedef struct
{
int button_num;
int Y_offset;
int Y_length;
} DISPLAY_STRUCT;
typedef struct
{
Widget temp_widget;
Widget temp_drawing_area;
Widget temp_main_window_widget;
Display *temp_display;
Window temp_window;
int temp_screen;
GC temp_gc;
} POPUP_STRUCT;
typedef struct
{
int on;
int Y_mult; /* This is the multiplier value */
POPUP_STRUCT popup;
} COMMAND_STRUCT;
typedef struct colorHelpStruct
{
Widget drawing_area;
Widget main_window_widget;
Widget toplevel;
Display *display;
Window window;
int screen;
GC gc;
} COLOR_HELP_STRUCT_DATA;
typedef struct
{
Widget shell_widget;
Widget main_window_widget;
Widget paned_w;
Widget DrawAreaW; /* For those window who need a drawing area */
/*
* For those windows who want a scrolled window...
*/
Widget form_w;
Widget title_label;
/*
* "multi-view" stuff......
*/
Widget menu_bar; /* The menu bar widget */
Widget pull_down_menu_widget; /* The pull down menu widget */
Widget view_toggle_widget; /* The view Cascade button */
Widget *screen_widget_list; /* list of view push button widgets */
Widget *view_current_sort_widget; /* current sort widget for each view */
int *view_sort_mode; /* current sort mode for each view */
Widget *toggle_widget; /* all widgets for all screens.... */
int current_screen_mode; /* The current screen */
/*
* "options" stuff......
*/
Widget option_menu_bar; /* The menu bar widget */
Widget option_pull_down_menu_widget; /* The pull down menu widget */
Widget option_view_toggle_widget; /* The view Cascade button */
Widget *option_screen_widget_list; /* list of option push button widgets */
#ifdef OLD_WAY
char *current_screen; /* Pointer to ps_menu_struct */
int current_screen_number; /* number of entries of
ps_menu_struct */
Widget *current_view; /* current view */
/*
Widget ps_mem_widget_list [3][14];
*/
Widget *toggle_widget_screen_2; /* view 2 ..... */
Widget *toggle_widget_screen_3; /* view 3 ..... */
Widget *toggle_widget_screen_4; /* view 4 ..... */
#endif
/**********/
Widget vsb; /* Vertical scroll bar */
Widget hsb; /* Horizontal scroll bar */
int window_type;
Pixmap pixmap;
/*
* Size of top-level shell
*/
int width,height;
int max_width,max_height;
int min_width,min_height;
int x1,y1;
/*
* Size of drawing area....
*/
int draw_width,draw_height;
/* Current size of pixmap */
int pixmap_cur_width;
int pixmap_cur_height;
/*
* Geometry sizes according to querying of the resource database...
*/
char *class_name;
int GeometryQueryResults;
int GeometryWidth,GeometryHeight;
Window window;
int screen;
Display *display;
XWindowAttributes DrawAreaXYWH;
GC gc;
DestroyCallbackClientData *destroy_client_data_pointer;
int Y_mult;
int first_expose;
int already_created;
int help_color_already_created;
struct colorHelpStruct colorHelp;
int x, y; /* position before it is unrealized */
} SEPERATE_WINDOWS_STRUCT;
#define CPU_AVG_MAX 10
#define WAIT_AVG_MAX 10
typedef struct NetworkXswStruct
{
/*
* Forward and backword links for servers
*/
struct NetworkXswStruct *forward_link;
struct NetworkXswStruct *backward_link;
/*
* Server name
*/
char *server_name;
/*
* Socket descriptor
*/
int FileDescriptor;
int connected;
/*
* Timer interval id for sampling timer....
*/
XtIntervalId timer_id;
/*
* Sampling time cycle wanted and actual time period
*/
unsigned long StatCycle_msec;
long StatPeriod_msec;
int user_data_pointer;
/*
* Message line....
*/
char *message;
/*
* Fonts structure.....
*/
XFontStruct *test_fonts;
int current_font;
Font My_font;
char *font_name;
int have_res_font;
int font_change;
/*
* Time that kernel data was obtained and
* Last time that kernel data was obtained
*/
struct timeb timeb_info_read;
struct timeb timeb_last_info_read;
/*
* Window's control structures for managing all windows
*/
DISPLAY_STRUCT DISPLAY_LIST[Max_state_buttons];
COMMAND_STRUCT COMMAND_LIST[Max_state_buttons];
SEPERATE_WINDOWS_STRUCT SEPERATE_WINDOWS_LIST[Max_state_buttons];
int current_items;
int TOGGLE_BUTTONS_STATE[Max_state_buttons];
int scroll_bar_expose;
/*
* Hertz value....
*/
int hz;
int PctScale_width;
int PctScale_xoffset;
/*
* "Cpu" window variables....
*/
int cpu_avg_init;
time_t *cpu_avg[CPU_AVG_MAX];
time_t cpu_ticks[5];
/*
* "Wait" window variables....
*/
int wait_avg_init;
time_t *wait_avg[WAIT_AVG_MAX];
time_t wait_ticks[5];
/*
* "Cache" window variables....
*/
long initial_lwrite;
long initial_bwrite;
long initial_lread;
long initial_bread;
long lwrite_cummulative;
long bwrite_cummulative;
long lread_cummulative;
long bread_cummulative;
int avg_percent_write;
int avg_percent_read;
/*
* "Other" window variables....
*/
int file_count;
int inode_count;
int proc_count;
int region_count;
int myclist;
int callout_count;
int mount_count;
int file_max;
int inode_max;
int proc_max;
int region_max;
int myclist_max;
int callout_max;
int mount_max;
/*
* "Disk Space" window variables...
*/
int current_disk_space_entries;
int max_disk_space_entries;
struct disk_space_struct *current_disk_space;
struct disk_space_struct *current_disk_space_bak;
int current_disk_space_entries_bak;
int show_disk_totals;
int show_nfs;
/*
* "MEM" window variables....
*/
long cummulative_memory_used;
long cummulative_swap_used;
long cummulative_avail_swap;
int memory_sample_count;
/*
* "Streams" window variables......
*/
int *mynmblock;
struct strstat *mystreams;
struct pagestat *pagest;
ushort *rbsize;
uint *Rbsize;
/*
* "Dev. Stats." window varaibles.....
*/
int got_scsi_disk_stats;
int got_scsi_tape_stats;
int got_scsi_rom_stats;
int got_esdi_disk_stats;
int got_wd_disk_stats;
int got_cart_tape_stats;
int got_floppy_disk_stats;
int cur_device_displayed;
int max_device_displayed;
struct iotime floppy_disk_stats[4];
struct iotime old_floppy_disk_stats[4];
struct iotime Sdsk_stats[4];
struct iotime old_Sdsk_stats[4];
struct iotime Stp_stats[4];
struct iotime old_Stp_stats[4];
struct iotime Srom_stats[4];
struct iotime old_Srom_stats[4];
struct iotime esdi_disk_stats[4];
struct iotime old_esdi_disk_stats[4];
struct iotime wd_disk_stats[4];
struct iotime old_wd_disk_stats[4];
struct iotime cart_tape_stats[4];
struct iotime old_cart_tape_stats[4];
/*
* "PS CPU, PS I/O, and PS MEM" window variables....
*/
struct proc *real_procs;
struct proc *start_real_procs;
struct my_user_struct *start_my_user;
struct my_user_struct *my_user;
struct my_user_struct *old_my_user;
struct my_proc_struct *start_procs;
struct my_proc_struct *procs;
struct my_proc_struct *oldprocs;
struct my_proc_struct **poldprocs;
struct my_proc_struct **pprocs;
int procs_alive;
int old_procs_alive;
int slots_in_use;
int old_slots_in_use;
int max_slots_in_use;
int old_max_slots_in_use;
time_t boot_time;
/*
* PS MEM info.....
*/
process_memory *heap_memory_pointer;
process_memory_bak *memory_pointer_bak;
int current_mem_procs;
int current_mem_procs_bak;
int num_active_process;
int *new_memory_state;
int *memory_state;
int got_memory_state;
/*
* General stuff for PS......
*/
MyButton PS_MyButton_decl[PS_MyButton_QUAN];
MyButton IO_PS_MyButton_decl[IO_PS_MyButton_QUAN];
MyButton MEM_PS_MyButton_decl[MEM_PS_MyButton_QUAN];
int nprocs;
int noldprocs;
/*
* "NFS Stats." window variables....
*/
int nfs_available;
int must_be_32v5;
struct
{
int rccalls;
int rcbadcalls;
int rcretrans;
int rcbadxids;
int rctimeouts;
int rcwaits;
int rcnewcreds;
int rcpeekerrs;
int rcbadresponses;
} rcstat;
struct
{
int nclsleeps;
int nclgets;
int ncalls;
int nbadcalls;
int reqs[32];
} clstat;
struct
{
int rscalls;
int rsbadcalls;
int rsnullrecv;
int rsbadlen;
int rsxdrcall;
} rsstat;
struct
{
int ncalls;
int nbadcalls;
int reqs[32];
} svstat;
struct sysinfo *my_sysinfo;
struct sysinfo *my_sysinfo_last;
struct minfo *my_minfo;
struct minfo *my_minfo_last;
int my_nswap;
int *my_maxmem;
int *my_freemem;
int *my_availsmem;
/*
* "VBT" window variables....
*/
struct var *my_v;
struct tune *my_tune;
struct bootinfo *my_bootinfo;
char bootstring[B_MAXSTRLEN];
int configuration_string_size;
char *configuration_string;
int send_data_count;
int first_server_read;
int made_contact;
int minimum_data;
/* Variables for first reading of sysinfo. Need for cache avg calculations */
int ps_procs_to_display;
int ps_cpu_sort_order;
int ps_io_sort_order;
int ps_cpu_time_mode;
int ps_sort_mode;
int ps_display_mode;
int ps_io_sort_mode;
int ps_io_display_mode;
int ps_io_time_mode;
/*
* PS MEM per screen/view stuff
*/
int ps_mem_sort_order;
int *ps_mem_sort_mode;
int ps_mem_screen_mode;
int disk_space_sort_order;
int *disk_space_sort_mode;
int disk_space_screen_mode;
/****/
int ps_mem_display_mode;
int in_expose_callback;
int in_set_display_mode;
int ps_button_change;
int ps_io_button_change;
int ps_mem_button_change;
struct scoutsname scoutsname;
struct utsname memuts;
struct utsname sysuts;
int os_version;
} NetworkXsw;
extern struct NetworkXswStruct *current_server;
typedef struct expose_callback_struct
{
struct NetworkXswStruct *server_pointer;
int button_number;
} EXPOSE_CALLBACK_STRUCT;
struct _window_init_struct window_init_data[Max_state_buttons];
#define StatCycle_msecDef 4000L
#define StatCycle_msecMin 100L
#define StatCycle_msecMax 60000L
#define min(a,b) (((a) > (b)) ? (b) : (a))
#define FASCENT (current_server->test_fonts->ascent)
#define DESCENT (current_server->test_fonts->descent)
#define FHEIGHT (current_server->test_fonts->ascent + current_server->test_fonts->descent)
#define FWIDTH (current_server->test_fonts->min_bounds.width)
#define CHEIGHT (current_server->test_fonts->min_bounds.ascent + current_server->test_fonts->min_bounds.descent)
#define FGAP (1)
#define BORDER_EXTRA_WIDTH (FGAP)
#define SMALL_BOX_WIDTH (FWIDTH * 80)
#define SMALL_BOX_HEIGHT (FHEIGHT * 5) + DESCENT
#define Start_Y_offset (FHEIGHT * 3)
#define Tod_WIDTH (FWIDTH * 8)
#define Tod_TLX (DrawAreaXYWH.width - Tod_WIDTH - FGAP)
#define Tod_TLY (FHEIGHT * 0)
#define User_WIDTH (FWIDTH * 9)
#define User_TLX (DrawAreaXYWH.width - User_WIDTH - FGAP)
#define User_TLY (FHEIGHT * 1)
#define Disp_msg_TLY (FHEIGHT * 2)
#define StatPeriod_WIDTH (FWIDTH * 20)
#define StatPeriod_TLX (Tod_TLX - StatPeriod_WIDTH - (FWIDTH * 2))
#define StatPeriod_TLY (FHEIGHT * 0)
#define StatCycle_WIDTH (FWIDTH * 17)
#define StatCycle_TLX (StatPeriod_TLX - StatCycle_WIDTH - (FWIDTH * 2))
#define StatCycle_TLY (FHEIGHT * 0)
#define CpuScale_TLX 0
#define CpuScale_TLY (FHEIGHT * 3)
#define WaitScale_TLX 0
#define WaitScale_TLY (FHEIGHT * 7)
#define FilesScale_TLY (FHEIGHT * 11)
#define FilesScale_TLX 0
#define CacheScale_TLY (FHEIGHT * 16)
#define CacheScale_TLX 0
/* Sysinfo/Minfo per second area */
#define Sysinfo_TLY (FHEIGHT * 19) /* absolute ... */
#define Sysinfo_TLX (FWIDTH * 0) /* ... positions */
#define Sysinfo1_TLX (FWIDTH * 0) /* offsets */
#define Sysinfo2_TLX (FWIDTH * 18)
#define Sysinfo3_TLX (FWIDTH * 35)
#define Sysinfo4_TLX (FWIDTH * 51)
#define Sysinfo5_TLX (FWIDTH * 66)
#define Nfsstat1_TLX (FWIDTH * 0) /* offsets */
#define Nfsstat2_TLX (FWIDTH * 9) /* offsets */
#define Nfsstat3_TLX (FWIDTH * 18)
#define Nfsstat4_TLX (FWIDTH * 26)
#define Nfsstat5_TLX (FWIDTH * 35)
#define Nfsstat6_TLX (FWIDTH * 42)
#define Nfsstat7_TLX (FWIDTH * 52)
/*
#define Nfsstat8_TLX (FWIDTH * 71)
*/
/* extra info area */
#define EXTRA_TLY (FHEIGHT * 34) /* absolute ... */
#define EXTRA_TLX (FWIDTH * 0) /* ... positions */
#define EXTRA1_TLX (FWIDTH * 0) /* offsets */
#define EXTRA2_TLX (FWIDTH * 18)
#define EXTRA3_TLX (FWIDTH * 43)
#define EXTRA4_TLX (FWIDTH * 62)
#define Var_TLX (EXTRA_TLX + EXTRA1_TLX)
#define Var_TLY EXTRA_TLY
#define Bootinfo_TLX (EXTRA_TLX + EXTRA2_TLX)
#define Bootinfo_TLY EXTRA_TLY
#define Tune_TLX (EXTRA_TLX + EXTRA3_TLX)
#define Tune_TLY EXTRA_TLY
#define Proc_TLX (EXTRA_TLX + EXTRA4_TLX)
#define Proc_TLY EXTRA_TLY
#define MIN_PCT_SCALE_WIDTH 100
/* 6 == 6x10, 20 == number of characters to left of pct scales */
/*
0000000000111111111122222222223333333333444444444455555555556666666666777777777
0123456789012345678901234567890123456789012345678901234567890123456789012345678
1 93 100 000 000 uuuuuuuuuuuuuuuuuuuuuuuuuuukkkkkkkkkkkkkkkkkkk
5 87 100 000 000 uuuuuuuuuuuuukkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
10 89 45 44 0 uuuuuuuuuuuuuuuuuuuuuukkkkkkkkkkkkkkkkkkkkkk
*/
#define DrawArea_MIN_WIDTH SMALL_BOX_WIDTH
/* 6 == 6x10, 29 == number of characters to left of pct scales */
/*
0000000000111111111122222222223333333333444444444455555555556666666666777777777
0123456789012345678901234567890123456789012345678901234567890123456789012345678
Instant % 93 54 39 0 uuuuuuuuuuuuuuuuuuuuuuuuuuukkkkkkkkkkkkkkkkkkk
5 Sec Avg % 87 26 61 0 uuuuuuuuuuuuukkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
10 Sec Avg % 89 45 44 0 uuuuuuuuuuuuuuuuuuuuuukkkkkkkkkkkkkkkkkkkkkk
*/
#define DrawArea_MIN_HEIGHT SMALL_BOX_HEIGHT
extern XtAppContext appcon;
extern Widget toplevel;
extern Widget MainWindowW;
extern Widget DrawAreaW;
extern XWindowAttributes DrawAreaXYWH;
extern Display *display;
extern Window window;
extern GC gc;
extern Colormap cmap;
extern int screen;
extern Window root_window;
extern int color_map;
extern XColor colorBackground;
extern XColor colorForeground;
extern XColor colorTitleBarFG;
extern XColor colorTitleBarBG;
extern XColor colorLabel;
extern XColor colorDisplayMsg;
extern XColor colorUsers;
extern XColor colorTimeOfDay;
extern XColor colorInterval;
extern XColor colorActualInterval;
extern XColor colorActualIntervalAlarm;
extern XColor colorActualIntervalWarning;
extern XColor colorUser;
extern XColor colorKernel;
extern XColor colorBreak;
extern XColor colorIo;
extern XColor colorPio;
extern XColor colorSwap;
extern XColor colorNfile;
extern XColor colorNinode;
extern XColor colorNproc;
extern XColor colorNregion;
extern XColor colorNcblocks;
extern XColor colorNfileWarning;
extern XColor colorNinodeWarning;
extern XColor colorNprocWarning;
extern XColor colorNregionWarning;
extern XColor colorNcblocksWarning;
extern XColor colorNfileAlarm;
extern XColor colorNinodeAlarm;
extern XColor colorNprocAlarm;
extern XColor colorNregionAlarm;
extern XColor colorNcblocksAlarm;
extern XColor colorCacheWriteHit;
extern XColor colorCacheReadHit;
extern XColor colorCacheWriteMiss;
extern XColor colorCacheReadMiss;
extern XColor colorCacheWriteMissWarning;
extern XColor colorCacheReadMissWarning;
extern XColor colorCacheWriteMissAlarm;
extern XColor colorCacheReadMissAlarm;
extern XColor colorPSmem;
extern XColor colorPSmemGrowing;
extern XColor colorPSmemShrinking;
extern XColor colorPSmemNew;
extern XColor colorPScpuIdle;
extern XColor colorPScpuActive;
extern XColor colorPScpuNew;
extern XColor colorPScpuRunning;
extern XColor colorPSioIdle;
extern XColor colorPSioActive;
extern XColor colorPSioNew;
extern XColor colorDiskspaceGaining;
extern XColor colorDiskspaceLosing;
extern XColor colorDiskspaceStable;
extern XColor colorAuxButtonOnForeground;
extern XColor colorAuxButtonOnBackground;
extern XColor colorAuxButtonOffForeground;
extern XColor colorAuxButtonOffBackground;
extern XColor colorNumeric;
extern XColor colorNumericWarning;
extern XColor colorNumericAlarm;
extern XColor colorStaticNumeric;
extern XColor colorMemUsed;
extern XColor colorMemUsedWarning;
extern XColor colorMemUsedAlarm;
extern XColor colorSwapUsed;
extern XColor colorSwapUsedWarning;
extern XColor colorSwapUsedAlarm;
extern XColor colorAvailSwapUsed;
extern XColor colorAvailSwapUsedWarning;
extern XColor colorAvailSwapUsedAlarm;
extern unsigned long foreground;
extern unsigned long background;
extern int redrawing_entire_DrawArea;
extern int MyButtons_next_tlx;
extern int DispMsg_tlx;
#define sysidelta(x) (current_server->my_sysinfo->x - current_server->my_sysinfo_last->x)
#define midelta(x) (current_server->my_minfo->x - current_server->my_minfo_last->x)
extern swpt_t swaptab[];
/*
extern swpi_t swapin;
*/
extern struct utsname utsname;
/* vi: set tabstop=4 shiftwidth=4: */
/* end of xsw.h */